//
//  CYWenDaDiCengTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/2/13.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYWenDaDiCengTableViewCell.h"
#import "CYPubilishQuestionViewController.h"

@implementation CYWenDaDiCengTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.backView.layer.cornerRadius = 5;
    self.backView.layer.masksToBounds = YES;
    
    self.huidaBtn.layer.cornerRadius = 2;
    self.huidaBtn.layer.masksToBounds = YES;
}

- (void)setModel:(CYProjectModel *)model{
    _model = model;
    self.contentLabel.text = model.title;
    [self.huidaCountBtn setTitle:[NSString stringWithFormat:@"查看%@个回答>", model.answer_number] forState:UIControlStateNormal];
}

- (IBAction)huidaAction:(UIButton *)sender {
    //我来回答
    CYPubilishQuestionViewController *huida = [[CYPubilishQuestionViewController alloc] init];
    huida.type = TiWenType_WoLaiHuiDa;
    huida.biaoti = self.model.title;
    huida.questionId = self.model.ID;
    [[AppDelegate sharedAppDelegate] pushViewController:huida];
}

- (IBAction)chakanHuidaAction:(UIButton *)sender {
    [[AppDelegate sharedAppDelegate] popViewController];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
